<template>
  <div>
    <div>123</div>
    <button @click="multSumbit">提交</button>
  </div>
</template>
<script>
import axios from 'axios'
export default {
    data () {
    },
    methods: {
      multSumbit() {
        let array = [1, 2, 3]
        var values = {
           end_time : null
        }
        if (typeof values.end_time === "undefined"|| values.end_time === null || values.end_time == ""){
            // 这里也可以写成 values.end_time === undefined
            values.end_time = null
        } else {
            values.end_time = '19088'
        }

        console.log (typeof(undefined) === 'undefined') // true  等号后面必须加引号
        console.log (undefined === undefined) // true   等号后面绝对不能加引号
        console.log (null === null) // true
        console.log ('' === '') // true 

        let formdata = new FormData()
        formdata.append("array", array);
        formdata.append("str", '');
        formdata.append("num", 'null');
        formdata.append("endtime", values.end_time);

        axios.post('/user',formdata ).then(function (response) {
           console.log(response)
        })
      },
    }
}
</script>
